package com.example.studentregistration.mapper;

import com.example.studentregistration.pojo.CheckIn;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CheckInMapper {
    int insert(CheckIn entity);
    int update(CheckIn entity);
    int delete(Integer id);
    CheckIn findById(Integer id);
    List<CheckIn> findAll();
    int batchDelete(@Param("ids") List<Integer> ids);

    // 业务相关
    CheckIn findActiveByStudentId(@Param("studentId") Integer studentId);
    CheckIn findActiveByBed(@Param("buildingId") Integer buildingId,
                            @Param("roomId") Integer roomId,
                            @Param("bedNo") String bedNo);
    List<CheckIn> findByRoomId(@Param("roomId") Integer roomId);
}